import Vue from 'vue'
import App from './App.vue'



import http from '@/utils/request.js';


import Tab from '@/components/Tab.vue';
import MyTable from '@/components/MyTable.vue';
import MyPage from '@/components/MyPage.vue';





// import router from '@/router/index.js'
import router from '@/router';
import store from '@/utils/store.js';


// 导入全局的样式
import './assets/reset.css'

// 引入样式
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import service from "@/utils/request.js";
//注册全局的ElementUI组件
Vue.use(ElementUI);//button form  table 

//定义全局组件 全局定义一次，
Vue.component('Tab',Tab);
Vue.component('MyTable',MyTable);
Vue.component('MyPage',MyPage);



Vue.config.productionTip = false

Vue.prototype.$http = http;

new Vue({
  render: h => h(App),
  store,
  router,
  
}).$mount('#app')


Vue.mixin({
  methods:{
    getConstantsItem(type,recive){
      service({
        url: '/constantsItem/getItemsByType',
        method: 'get',
        params:{type:type}
      }).then(list=>{
        recive(list)
      })
    }
  }


})
